package com.xcw;

/**
 * @Author bhx
 * @Date 2022/9/12 23:09
 * @Description TODO
 */
public class MainTest {
    public static void main(String[] args) {
        Originator originator = new Originator();
        CareTaker careTaker = new CareTaker();

        originator.setState("状态1 ");
        careTaker.add(originator.saveStateMemento());

        originator.setState("状态2 ");
        careTaker.add(originator.saveStateMemento());

        originator.setState("状态3");
        System.out.println("开始：当前状态为：" + originator.getState());
        careTaker.add(originator.saveStateMemento());
   }
}

